Skip to content

Conversation

jesswrd
Copy link
Contributor

@jesswrd jesswrd commented Jul 23, 2025

Merged hardcoded compileSdkVersion instead of using flutter.compileSdkVersion. Reverting back to flutter.compileSdkVersion.

Pre-Review Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. 2 3

@jesswrd jesswrd requested a review from camsim99 as a code owner July 23, 2025 18:19
@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging.

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly reverts a hardcoded compileSdkVersion in the camera_android plugin's build.gradle file, replacing it with the flutter.compileSdkVersion variable. This is the correct approach, ensuring the plugin respects the SDK version of the consuming Flutter application, which improves compatibility and maintainability. The change is sound and aligns with best practices for Flutter plugin development. I have no further comments.

@jesswrd jesswrd added override: no versioning needed Override the check requiring version bumps for most changes override: no changelog needed Override the check requiring CHANGELOG updates for most changes labels Jul 23, 2025
}
}
if (!compileSdkLine.contains('flutter.compileSdkVersion') && minFlutterVersion! >= Version(3, 27, 0)) {
printError('${indentation}Please use flutter.compileSdkVersion instead '
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
printError('${indentation}Please use flutter.compileSdkVersion instead '
printError('${indentation}Warning: please use flutter.compileSdkVersion instead '

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A useful warning requires some sort of message at the bottom of the gradle_check_command output. Will probably have to look in package_looping_command.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per my comment in the other PR, a message at the bottom of the output still won't really be a useful warning most of the time. We have printWarning, which will cause a message in the summary at the end, but as it says in its docs:

  /// Warnings are not surfaced in CI summaries, so this is only useful for
  /// highlighting something when someone is already looking though the log
  /// messages. DO NOT RELY on someone noticing a warning; instead, use it for
  /// things that might be useful to someone debugging an unexpected result.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Taking this over--how about we keep the printError and just return false? The validation will fail then they can look through the logs to see the reason why.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some context got lost here; this thread in the original PR explains the problem with making it an error to use a value.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Understood. I added a check for lower that flutter.compileSdkVersion. Of course, that isn't great because it relies on a hard coded version of that value and not the actual value itself, so we would have to update the command every time flutter.compileSdkVersion is used, so more maintenance burden. But, I'm okay keeping it.

Also, I considered adding a check for version == flutter.compileSdkVersion but I don't think that's a major value add, but let me know if you disagree.

}
}
if (!compileSdkLine.contains('flutter.compileSdkVersion') && minFlutterVersion! >= Version(3, 27, 0)) {
printError('${indentation}Please use flutter.compileSdkVersion instead '
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per my comment in the other PR, a message at the bottom of the output still won't really be a useful warning most of the time. We have printWarning, which will cause a message in the summary at the end, but as it says in its docs:

  /// Warnings are not surfaced in CI summaries, so this is only useful for
  /// highlighting something when someone is already looking though the log
  /// messages. DO NOT RELY on someone noticing a warning; instead, use it for
  /// things that might be useful to someone debugging an unexpected result.

@stuartmorgan-g
Copy link
Collaborator

From triage: What's the status of this PR? We still want to fix this, right?

}
}
if (!compileSdkLine.contains('flutter.compileSdkVersion') && minFlutterVersion! >= Version(3, 27, 0)) {
printError('${indentation}Please use flutter.compileSdkVersion instead '
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some context got lost here; this thread in the original PR explains the problem with making it an error to use a value.

Copy link
Collaborator

@stuartmorgan-g stuartmorgan-g left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

return false;
}
} else {
// Extract compileSdkVersion and check if it higher than flutter.compileSdkVersion.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: if it is

@camsim99 camsim99 added the autosubmit Merge PR when tree becomes green via auto submit App label Sep 29, 2025
@auto-submit auto-submit bot merged commit 15acade into flutter:main Sep 30, 2025
80 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 1, 2025
github-merge-queue bot pushed a commit to flutter/flutter that referenced this pull request Oct 1, 2025
flutter/packages@287739d...321a584

2025-09-30 [email protected] [local_auth] Adopt structured errors
- platform interface (flutter/packages#10023)
2025-09-30 [email protected] Revert hardcoded compilesdk back to
`flutter.compileSdkVersion` in `camera_android` (flutter/packages#9668)
2025-09-30 [email protected] [file_selector] updates build
files to use JVM 17 (flutter/packages#10097)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC [email protected] on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App override: no changelog needed Override the check requiring CHANGELOG updates for most changes override: no versioning needed Override the check requiring version bumps for most changes p: camera platform-android
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants